﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace DataAccess
{
    public partial class DaAccess : Form
    {
        public DaAccess()
        {
            InitializeComponent();
        }
        IOFile io = new IOFile();
        private void button1_Click(object sender, EventArgs e)
        {
            if ( textBox1.Text != "" && textBox2.Text != "" )
            {
                io.writeLog(textBox1.Text + " " + textBox3.Text + " " + textBox2.Text + " " + database.Text);
                MessageBox.Show ( "连接设置完毕， 请手动重启程序！" , "提示" , MessageBoxButtons.OK , MessageBoxIcon.Information );
                Application.Exit ();
            }
        }

        private void button2_Click ( object sender , EventArgs e )
        {
            Application.Exit ();
        }

        private void DaAccess_KeyDown ( object sender , KeyEventArgs e )
        {
            if ( e.KeyCode == Keys.Escape )
            {
                Application.Exit ();
            }
        }

    }
}
